//
// Notes to End Users.
//
// The workflow should run without editing this configuration file,
// however there may be instances in which you wish to edit this
// file for compute performance or other reasons. Please see:
//
//   https://nextflow.io/docs/latest/config.html#configuration
//
// for further help editing this file.


params {
    help = false
    out_dir = "output"
    store_dir = null
    version = false
    fastq = null
    bam = null
    references = null
    igv = false
    reference_mmi_file = null
    counts = null
    prefix = null
    sample = null
    sample_sheet = null
    disable_ping = false
    depth_coverage = true
    analyse_unclassified = false
    minimap_preset = "dna"
    minimap_args = null
    threads = 4
    per_read_stats = false

    monochrome_logs = false
    validate_params = true
    show_hidden_params = false
    schema_ignore_params = 'show_hidden_params,validate_params,monochrome_logs,aws_queue,aws_image_prefix,wf'

    wf {
        num_depth_windows = 200
        max_depth_window_size = 10000
        igv_locus_depth_threshold = 10
        example_cmd = [
            "--fastq 'wf-alignment-demo/fastq'",
            "--references 'wf-alignment-demo/references'",
        ]
        container_sha = "shafd8c4500ccf8b133bef07111626b9e7d876c430d"
        common_sha = "sha1c69fd30053aad5d516e9567b3944384325a0fee"
    }
}


manifest {
    name            = 'epi2me-labs/wf-alignment'
    author          = 'Oxford Nanopore Technologies'
    homePage        = 'https://github.com/epi2me-labs/wf-alignment'
    description     = 'Align Nanopore reads and visualize mapping statistics.'
    mainScript      = 'main.nf'
    nextflowVersion = '>=23.04.2'
    version         = 'v1.2.3'
}

epi2melabs {
    tags = 'wf-alignment,minimap2,alignment,mapping,utility'
}


// used by default for "standard" (docker) and singularity profiles,
// other profiles may override.
process {
    withLabel:wfalignment {
        container = "ontresearch/wf-alignment:${params.wf.container_sha}"
    }
    withLabel:wf_common {
        container = "ontresearch/wf-common:${params.wf.common_sha}"
    }
    shell = ['/bin/bash', '-euo', 'pipefail']
}


profiles {
    // the "standard" profile is used implicitly by nextflow
    // if no other profile is given on the CLI
    standard {
        docker {
            enabled = true
            // this ensures container is run as host user and group, but
            //    also adds host user to the within-container group
            runOptions = "--user \$(id -u):\$(id -g) --group-add 100"
        }
    }

    // using singularity instead of docker
    singularity {
        singularity {
            enabled = true
            autoMounts = true
        }
    }


    // keep stub conda profile to prevent unknown profile warning so users get a better error
    conda {
        conda.enabled = true
    }


    // Using AWS batch.
    // May need to set aws.region and aws.batch.cliPath
    awsbatch {
        process {
            executor = 'awsbatch'
            queue = "${params.aws_queue}"
            memory = '8G'
            withLabel:wfalignment {
                container = "${params.aws_image_prefix}-wf-alignment:${params.wf.container_sha}"
            }
            withLabel:wf_common {
                container = "${params.aws_image_prefix}-wf-common:${params.wf.common_sha}"
            }
            shell = ['/bin/bash', '-euo', 'pipefail']
        }
    }



    // local profile for simplified development testing
    local {
        process.executor = 'local'
    }
}

timeline {
    enabled = true
    overwrite = true
    file = "${params.out_dir}/execution/timeline.html"
}
report {
    enabled = true
    overwrite = true
    file = "${params.out_dir}/execution/report.html"
}
trace {
    enabled = true
    overwrite = true
    file = "${params.out_dir}/execution/trace.txt"
}

env {
    PYTHONNOUSERSITE = 1
    JAVA_TOOL_OPTIONS = "-Xlog:disable -Xlog:all=warning:stderr"
}
